﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLL.Entities;

namespace BLL
{
    public class VisitsReport : IReport
    {
        public Dictionary<Trainee, List<GymVisit>> visits;

        public VisitsReport()
        {
            visits = new Dictionary<Trainee, List<GymVisit>>();
        }

        public void Create(int i_Month, int i_Year)
        {
            foreach (var trainee in TraineeManager.Instance.GetTrainees())
            {
                List<GymVisit> temp = new List<GymVisit>();

                foreach (var visit in TraineeManager.Instance.GetVisits(trainee as Trainee))
                {
                    GymVisit v = (visit as GymVisit);
                    if (v.Start.Month == i_Month && v.Start.Year == i_Year)
                    {
                        temp.Add(v);
                    }
                }

                visits.Add((trainee as Trainee), temp);
            }
        }
    }
}
